package com.github.icloudpay.crm.core.biz;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.icloudpay.crm.core.entity.OrderInvoice;
import com.github.icloudpay.crm.core.mapper.OrderInvoiceMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;

/**
 * 开票订单表
 *
 * @author centerroot
 * @email lfw6699@163.com
 * @date 2018-05-25 15:20:48
 */
@Service
public class OrderInvoiceBiz extends BaseBiz<OrderInvoiceMapper,OrderInvoice> {
	
	private static final Logger logger = LoggerFactory.getLogger(OrderInvoiceBiz.class);
	
	@Autowired
	private OrderInvoiceMapper invoiceMapper;
	
	
	/**
	 * 开票订单
	 * @param map
	 * @return
	 */
	public Map<String, Object> queryInvoiceRecord(Map<String, Object> map) {
		logger.info("查询开票订单参数。。。{}"+map);
		List<OrderInvoice> list = invoiceMapper.queryInvoiceRecord(map);
		logger.info("查询开票订单。。。{}"+list);
		Map<String, Object> respMap = new HashMap<>();
		respMap.put("records", list);
		return respMap;
	}
	
	
	/**
	 * 开票
	 * @param map
	 * @return
	 */
	public Map<String, Object> updateStatus(Map<String, Object> map) {
		logger.info("开票参数。。。{}"+map);
		invoiceMapper.updateStatus(map);
		logger.info("开票完成。。。{}");
		Map<String, Object> resp = new HashMap<>();
		resp.put("result", "成功");
		return resp;
	}
	
}